package com.zaiboot.example.mapdemo;

import org.osmdroid.views.MapController;
import org.osmdroid.views.MapView;

import android.os.Bundle;
import android.app.Activity;
import android.view.Menu;
import android.view.View;

public class MainActivity extends Activity {

	private MapView myOpenMapView = null;
	private MapController myMapController;

	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_main);
		View v = findViewById(R.id.openmapview);
		try {
			myOpenMapView = (MapView)v;
		} catch (ClassCastException e) {
			///Cannot convert.
		}
		
		if (myOpenMapView != null) {
			myOpenMapView.setBuiltInZoomControls(true);
			myMapController = myOpenMapView.getController();
			myMapController.setZoom(4);
		}
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		getMenuInflater().inflate(R.menu.activity_main, menu);
		return true;
	}
}
